import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '../views/Layout'
import Work from '../views/Work'
import User from '../views/User'
import Message from '../views/Message'
import Status from '../views/Status'
import WTeacher from '../views/Work/teacher.vue'
import MTeacher from '../views/Message/teacher.vue'
import UTeacher from '../views/User/teacher.vue'

Vue.use(VueRouter)

const routes = [
	{
		path: '/',
		redirect: '/status' // 默认显示layout和layout下首页
	},
	// {
	// 	path: '/',
	// 	redirect: '/layout/work' // 默认显示layout和layout下首页
	// },
	// 选择角色
	{
		path: '/status',
		component: Status
	},
  {
  	path: '/layout',
  	component: Layout,
  	children: [
  		{
  			path: 'work',
  			component: Work
  		},
			{
				path: 'wteacher',
				component: WTeacher
			},
  		{
  			path: 'message',
  			component: Message
  		},
			{
				path: 'mteacher',
				component: MTeacher
			},
			{
				path: 'user',
				component: User
			},
			{
				path: 'uteacher',
				component: UTeacher
			}
  	]
  },
]

const router = new VueRouter({
  routes
})

export default router
